package learn_effective_java.item_32;

import java.util.List;
import java.util.concurrent.ThreadLocalRandom;

public class T1 {
	
	public static void main(String[] args) {
		
	}
	
	public static void dangerous(List<String>... stringLists) {
		List<Integer> intList = List.of(42);
		Object[] objects = stringLists;
		objects[0] = intList;
		String s = stringLists[0].get(0);
	}
	
	public static <T> T[] pickTwo(T a, T b, T c) {
		switch(ThreadLocalRandom.current().nextInt(3)) {
			case 0: return toArray(a, b);
			case 1: return toArray(a, c);
			case 2: return toArray(b, c);
		}
		throw new AssertionError();
	}
	
	static <T> T[] toArray(T... args) {
		return args;
	}
	
}
